{extends file="../home.html"}
{block name="title"}{$head_title}{/block}
{block name="css"}
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/front/front_css/detail_page.css?version={$version}"/>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/front/front_css/pinglun1_loading.css?version={$version}"/>
	<style type="text/css">
		body{
			background:#fff;
		}
		#load_wrapper{
			margin-bottom:2.45rem;
		}
		.comment-list{
			background:#fff;
		}
		h1{
			width:80%;
			overflow:hidden;
			text-overflow:ellipsis;
			white-space:nowrap;
		}
		.comment-list dl dt img{
			border-radius:100%;
		}
</style>
{/block}
{block name="content"}
{include file="../detail_header.html"}
<div id="load_wrapper">
	<div id="scroller">
	<div class="project-detail-banner">
		<img src="{$project.pic}" alt="" />
		<!--项目名称-->
		<div class="pro-name">
			<div class="clearfix title">
				<h1 class="fl">{$project.project_name}</h1>
				<span class="fr">收藏</span>
				<span class="fr icon collect-icon collect {if $project.is_collect}icon_like_selected3x{else}icon_like_default3x{/if}"></span>
			</div>
			<ul>
				<li class="clearfix mg-top0">
					<span class="fl">所属行业</span>
					<p class="fl">{$project.field_name}</p>
				</li>
				<li class="clearfix">
					<span class="fl">融资金额</span>
					<p class="fl">{$project.financing_money}</p>
				</li>
				<li class="clearfix">
					<span class="fl">投资阶段</span>
					<p class="fl">{$project.phase_name}</p>
				</li>
			</ul>
		</div>
		
	</div>
	<!--项目亮点-->
	<div class="pro-lightspot">
		<h4>项目亮点</h4>
		<a href="javascript:;">
			<p>
			{$project.project_highlight}
			</p>
		</a>
		<div class="border-line"></div>
	</div>
	<!--项目简介-->
	<div class="pro-intro">
		<h4>项目简介</h4>
		<a href="javascript:;">
			<p>
			{$project.project_desc}
			</p>
		</a>
	</div>
	<!--下载-->
	<div class="download">
		<div class="shadow"></div>
		<h2>下载</h2>
		<div class="download-cont clearfix">
			<dl>
				<dt>商业计划书</dt>
				<dd>
					<a href="{$project.plan_book}" class="down" data-label="download">
						<img src="/Public/Images/front/front_img/shouye_zixun_pic3x.png"/>
						<div class="shade"></div>
						<span class="pic icon_xiazai_default3x"></span>
					</a>
				</dd>
			</dl>
			<dl>
				<dt>自荐材料</dt>
				<dd>
					<a href="{$project.cover}" class="down" data-label="download">
						<img src="/Public/Images/front/front_img/shouye_zixun_pic3x.png"/>
						<div class="shade"></div>
						<span class="pic icon_xiazai_default3x"></span>
					</a>
				</dd>
			</dl>
		</div>
	</div>
	<!--活动评论-->
	<div class="comment">
		<h2>项目评论</h2>
	</div>
	
				<div class="comment-list">
					{foreach from=$comment_list item=v}
					<dl class="clearfix">
						<dt class="fl">
							<img src="{$v.headimgurl}"/>
						</dt>
						<dd class="fl">
							<div class="clearfix">
								<h3 class="fl">{$v.realname}</h3>
								<span class="fr">{$v.addtime}</span>
							</div>
							<p>{$v.contents}</p>
						</dd>
					</dl>
					{/foreach}
				</div>
				<div id="pullUp">
					<span class="pullUpIcon"></span><span class="pullUpLabel">上拉加载...</span>
				</div>
			</div>
	</div>
	<footer class="footer_fixed">
		<div class="footer_comment" onclick='express_will()'>表达意向</div>
		<a  onclick="check_user('/FrontEnjoy/add_project_comment/project_id/{$project.project_id}')" class="red">我要评论</a>
	</footer>
{/block}
{block name="js"}

	<script type="text/javascript" src="__PUBLIC__/Js/front/iscroll.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Js/front/front_js/comment_list.js"></script>
	<script type="text/javascript">
	var project_id = '{$project.project_id}'
	var firstRow = '{$firstRow}'
	var total = '{$total}'
	//分享的参数
	var share_pic = '{$project.pic}';
	var share_title = '{$project.project_name}';
	var desc_str = '{$project.project_desc}';
	var share_desc = desc_str.substr(0,30);
	var share_url = document.location.href;
{literal}
		//收藏
			$(".pro-name .collect").on("click",function(){
				var obj = $(this);
                if($(this).hasClass('icon_like_selected3x')){
                    var type = 0;//取消
                }else{
                    var type = 1;//收藏
                }
                
                $.ajax({
                    url:'/FrontEnjoy/collect_project',
                    type:'post',
                    data:{project_id:project_id, type:type},
                    success:function(r){
                        if(r.code == 0){
                            obj.toggleClass("icon_like_default3x").toggleClass("icon_like_selected3x");
                            layer.open({
	                            content: r.msg,
	                            title: false,
	                            btn: ['确定'],
	                        });
                        }else{
                            layer.open({
	                            content: r.msg,
	                            title: false,
	                            btn: ['确定'],
	                        });
                        }
                    }
                })
			});

		function express_will(){
			if(!check_user('')){
				console.log(111);
				return false;
			}

			$.ajax({
				url:'/FrontEnjoy/express_will',
				data:{project_id:project_id},
				type:'post',
				success:function(r){
					if(r.code == 0){
						console.log(11111);
						layer.open({
							content: r.msg,
							title: false,
							btn: ['确定'],
						});
						return;
					}else if(r.code == 1){
						layer.open({
							content: r.msg,
							title: false,
							btn: ['确定'],
						});
						setTimeout(function(){
							var dataUrl = '/FrontEnjoy/check_investor/project_id/'+project_id;
							var _json = JSON.stringify({
								event: "to_jump",
								params: {"url":dataUrl}
							});
							if(is_ios()){
								window.webkit.messageHandlers.webviewEvent.postMessage(_json);
							}else{
								window.ResultAndroid.webviewEvent(_json);
							}
						}, 2000);
					}
				}
			})
		}
{/literal}
	</script>

{/block}